package com.ming_za.odupdaterserver.core.vo.req;

import com.ming_za.odupdaterserver.core.annotation.ClientPath;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

@Schema(description = "添加资源所需参数")
@Data
public class ResAddVo {

    @Schema(description = "资源存在于客户端的地址")
    @NotEmpty(message = "客户端资源地址不能为空")
    @ClientPath(message = "非法路径")
    private String clientPath;

    @Schema(description = "是否为必须更新")
    @NotNull(message = "请填入是否必须更新")
    private Boolean necessary;

    @Schema(description = "是否为删除，如果为true，则可以忽略文件上传")
    @NotNull(message = "请填入是否为删除资源")
    private Boolean delete;

    @Schema(description = "资源标签（可选）",defaultValue = "0")
    @NotNull(message = "标签不能为null")
    private Long label;

    public ResAddVo(String clientPath, Boolean necessary, Boolean delete, Long label) {
        this.clientPath = clientPath;
        this.necessary = necessary;
        this.delete = delete;
        this.label = label;
    }
}
